home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / swtools / trubasic / rolldemos / chooser / sgchooser.tru < prev    next >
Text File  |  1994-08-02  |  3KB  |  130 lines

  1. ! driver for Demo Chooser program
  2. ! our excuse for not commenting this code is the 150 line limit
  3. ! imposed by the Demo version
  4. dim pts(9,4),txt$(9)
  5. PUBLIC d3pts(4,4),d3txt$(4)
  6. PUBLIC tbpts(7,4),tbtxt$(7)
  7. PUBLIC scipts(5,4),scitxt$(5)
  8. PUBLIC intpts(6,4),inttxt$(6)
  9. PUBLIC fontpts(2,4),fonttxt$(2)
  10. PUBLIC rgbpts(3,4),rgbtxt$(3)
  11. PUBLIC ippts(4,4),iptxt$(4)
  12. library "ipmenu.tru","rgbmenu.tru","fontmenu.tru","setup.tru"
  13. library "tbmenu.tru","intmenu.tru","3dmenu.tru","util.tru","scimenu.tru"
  14.  
  15. print
  16. print "Setting up demos.."
  17. print
  18. call tw_wset_size(0,684,684)
  19.  
  20. let binc=.15
  21. let xspace=.2
  22. let xoff=.075
  23. let yoff=.15
  24. let u=ubound(pts,1)
  25. for i=1 to u
  26.         let pts(i,1)=xoff
  27.         let pts(i,2)=pts(i,1)+binc
  28.         let pts(i,3)=yoff
  29.         let pts(i,4)=pts(i,3)+binc
  30.         let xoff=xoff+binc+xspace
  31.         if i=3 or i=6 then
  32.                 let yoff=yoff+.3
  33.                 let xoff=.075
  34.         end if
  35. next i
  36.  
  37. let txt$(1)="RGB Demos"
  38. let txt$(2)="Image Process"
  39. let txt$(3)="Licensing True BASIC"
  40. let txt$(4)="3D Demos"
  41. let txt$(5)="Scientific Demos"
  42. let txt$(6)="Interactive Demos"
  43. let txt$(7)="About True BASIC"
  44. let txt$(8)="Standard Demos"
  45. let txt$(9)="Font Demo"
  46. let r=setfontstyle("Bold")
  47. let r=setfontsize(9)
  48. set text justify "center","bottom"
  49.  
  50. call setup
  51.  
  52. clear
  53. call drawbox
  54. do
  55.     call getclick(op)
  56.  
  57.     if op=1 then
  58.         call rgb_demos
  59.         call drawbox
  60.         call waitup
  61.     else if op=2 then
  62.         call ip_demos
  63.         call drawbox
  64.         call waitup
  65.     else if op=3 then
  66.         chain "!cd ../demos;../basic/tru -i closeTBI.tru &", return
  67.     else if op=4 then
  68.         call d3_demos
  69.         call drawbox
  70.         call waitup
  71.     else if op=5 then
  72.         call sci_demos
  73.         call drawbox
  74.         call waitup
  75.     else if op=6 then
  76.         call int_demos
  77.         call drawbox
  78.         call waitup
  79.     else if op=7 then
  80.         chain "!cd ../demos;../basic/tru -i aboutTBI.tru &", return
  81.     else if op=8 then
  82.         call tb_demos
  83.         call drawbox
  84.         call waitup
  85.     else if op=9 then
  86.         call font_demos
  87.         call drawbox
  88.         call waitup
  89.     end if
  90.  
  91.     if op=3 or op=7 then
  92.                 call expand(pts(op,1),pts(op,2),pts(op,3),pts(op,4))   
  93.         draw textbox(pts(op,1),pts(op,2),pts(op,3),pts(op,4),txt$(op))
  94.                 call waitup
  95.                 pause 3
  96.                   call unexpand(pts(op,1),pts(op,2),pts(op,3),pts(op,4))   
  97.         draw textbox(pts(op,1),pts(op,2),pts(op,3),pts(op,4),txt$(op))
  98.     end if
  99.     if refresh(1)=1 then call drawbox
  100. loop
  101.  
  102. sub drawbox
  103.     let u=ubound(pts,1)
  104.     clear
  105.     for i=1 to u
  106.         draw orgbox(i)
  107.     next i
  108. end sub
  109.  
  110. sub getclick(op)
  111.     get mouse x,y,state
  112.     let op=0
  113.     if state<>0 then
  114.        let u=ubound(pts,1)
  115.        for i=1 to u
  116.         if x>pts(i,1) and x<pts(i,2) and y>pts(i,3) and y<pts(i,4) then
  117.             let op=i
  118.             exit sub
  119.         end if
  120.        next i
  121.     end if
  122. end sub
  123.  
  124. picture orgbox(op)
  125.     draw box(pts(op,1),pts(op,2),pts(op,3),pts(op,4),op)
  126.     draw textbox(pts(op,1),pts(op,2),pts(op,3),pts(op,4),txt$(op))
  127. end picture
  128.  
  129. end
  130.